<template>
	<view class="content">
		<image class="logo" src="/static/logo.png"></image>
		<view class="text-area">
			<text class="title">{{title}}</text>
			Uniapp+Springboot跨端实战
			温馨的酱牛肉{{this.$api.api}}
			{{this.$api.user_info}}
		</view>
		
		<view class="">
			<navigator url="../list/list">
				<button type="primary">跳转到list页面</button>
			</navigator>
		</view>
		
		<view class="">
			<button type="primary" @tap="naigatorList">api跳转</button>
		</view>
		
		<view class="">
			<button type="default" @tap="h5">跳H5</button>
		</view>
		
		<view class="">
			<button type="default" @tap="toTimePage">去定时器页面</button>
		</view>
		
		<view class="">
			{{emitData}}
			<button type="default" @tap="toEmitPage">去页面通讯</button>
		</view>
		
		<image src="../../static/mp-weixin/tim.jpg" mode=""></image>
		
	</view>
</template>

<script>
	export default {
		data() {
			return {
				title: 'Hello',
				emitData: ''
			}
		},
		onLoad() {
			uni.$on('inputData', data=>{
				this.emitData = data
				// console.log(data);
			})
		},
		methods: {
			
			naigatorList() {
				uni.navigateTo({
					url: '../list/list'
				})
				
				// uni.reLaunch({
				// 	url: '../list/list'
				// })
				
				// uni.redirectTo({
				// 	url: '../list/list'
				// })
				
				
			},
			
			h5() {
				uni.navigateTo({
					url: '/pages/h5/h5'
				})
			},
		
			toTimePage() {
				uni.navigateTo({
					url: '/pages/time/time'
				})
			},
			toEmitPage() {
				uni.navigateTo({
					url: '/pages/emit/emit'
				})
			}
			
		}
	}
</script>

<style>
	.content {
		display: flex;
		flex-direction: column;
		align-items: center;
		justify-content: center;
	}

	.logo {
		height: 200rpx;
		width: 200rpx;
		margin-top: 200rpx;
		margin-left: auto;
		margin-right: auto;
		margin-bottom: 50rpx;
	}

	.text-area {
		display: flex;
		justify-content: center;
	}

	.title {
		font-size: 36rpx;
		color: #8f8f94;
	}
</style>
